﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LibrarySync2.Common.Enum;

namespace LibrarySync2.Common.Event
{
    public class LibraryAnalysisEventArgs : EventArgs
    {
        public LibraryAnalysisStatusType Status { get; private set; }
        public int CurrentDirectory { get; private set; }
        public int TotalDirectoryCount { get; private set; }

        public LibraryAnalysisEventArgs(LibraryAnalysisStatusType status, int currentDirectory, int totalDirectoryCount)
        {
            Status = status;
            CurrentDirectory = currentDirectory;
            TotalDirectoryCount = totalDirectoryCount;
        }

        public override string ToString()
        {
            switch (Status)
            {
                case LibraryAnalysisStatusType.AnalyzingDirectory:
                    return string.Format("Analyzing directory {0} of {1}...", CurrentDirectory, TotalDirectoryCount);
                case LibraryAnalysisStatusType.BuildingFileList:
                    return "Building directory list...";
                case LibraryAnalysisStatusType.Cancelled:
                    return "Analysis cancelled.";
                case LibraryAnalysisStatusType.Complete:
                    return "Analysis complete.";
                case LibraryAnalysisStatusType.SerializingResults:
                    return "Serializing results...";
                default:
                    return base.ToString();
            }
        }
    }
}
